
#ifndef		PARAM_READER_H
#define		PARAM_READER_H

#include <fstream>

//reads param file 
class ParamReader
{
public:

	static bool load(const char* fname); 
	static void print(); 
static double	GAMMA				; //param:
static int		MAX_EPISODE_STEPS	;  //param:
static double	rmax				;		//param:	

static int		EST_SAMPLE_SIZE			;				// number of samples we pick from our generalizers when we try to appx a transition
static int		USE_GENERALIZATION_TIME	;		// time when we start using generalization
static int		USE_GENERALIZATION_END_TIME;	// time we stop using generalization
static bool		USE_GENERALIZATION		;				// are we using generalization or not

static bool		LEARN_GENERALIZATION	; //
static int		LEARN_GENERALIZATION_END_TIME	; 
static int		DELAY_DETECTION_TIME	; // the time we fix k
static int		DISCRETIZED_SIZE		 ; 		//how many cells per continuous dimension should we have
static int		SOLVE_PERIOD			;			//interval for solving our model
static int		BATCH_LEARNING_TIME		;		//at what intervals do we rerun the whole history for our transition function gen. 
static int		BATCH_LEARNING_END_TIME ;		//when do we stop batch learning (-1 for do not stop)
static int		RUN_TIMEOUT				;		//number of seconds till we kill one of actions (see the code)
static double	VI_EPSILON				;		//in value iteration, what is the termination criterion
static bool		USE_DETERMINISTIC_POLICY;		//use stocastic or deterministic policy
static bool		LOAD_MODEL			;		//whether load the previous experience or not 
static bool		SAVE_MODEL				;		//whether save the state to be used later
static int		RMAX_KNOWN_THRESHOLD	;		//rmax parameter
//related to fittedVISolver
static int		NUMBER_OF_VI_SAMPLES	;		//how many samples per dimension
static int		MULTISTEP_BACKUP_HORIZON		;		//when doing VI backup, how many steps do we look ahead: 0 is the default

private:
	static int readInt(const char* name, int& value);
	static double readDouble(const char* name, double& value); 
	static char* readString(const char* name, char*& value); 
	static bool readBool(const char* name, bool& value); 

	static std::ifstream cfgFile; 
	static bool skip2param(const char* tag);
	static char getNextChar(std::ifstream& cfg); 

};



#endif
